<!doctype html>
[#escape x as (x)!?html]
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>${node.name} - ${site.fullNameOrName}${global.customs['poweredBy']}</title>
    <meta name="keywords" content="${node.keywords}">
    <meta name="description" content="${node.description}">
    [#include 'inc_meta.html'/]
    [#include 'inc_css.html'/]
    [#include 'inc_js.html'/]
</head>
<body>
[#include 'inc_header.html'/]
<div class="container">
    <div class="row">
        <div class="col-lg-8 mt-3">
            <div class="bg-light p-2">
                [#assign parentId=node.parent.id/]
                [#if !node.parent.parent??]
                [#assign parentId=node.id/]
                <a class="btn btn-primary" href="${node.url}">全部</a>
                [#else]
                <a class="btn btn-link" href="${node.parent.url}">全部</a>
                [/#if]
                [@NodeList parentId=parentId;list]
                [#list list as bean]
                <a class="btn [#if node.id==bean.id]btn-primary[#else]btn-link[/#if]" href="${bean.url}">${bean.name}</a>
                [/#list]
                [/@NodeList]
            </div>
            [@InfoPage nodeId=node.id isIncludeChildren='true' pageSize='10';pagedList]
            <ul class="list-unstyled">
                [#list pagedList.content as bean]
                <li class="mt-3 media position-relative pb-3 border-bottom">
                    [#if bean.smallImage??]<img src="${bean.smallImage}" class="mr-3 img-thumbnail" width="48" height="48" alt="${bean.title}">[/#if]
                    <div class="media-body">
                        <p class="mt-0 mb-1"><a href="${bean.url}" class="text-reset stretched-link">${bean.title}</a></p>
                        <p class="small text-muted d-none d-sm-block mb-2">${substring(bean.description,80,'...')}</p>
                        <div class="small text-muted mt-2 clearfix">
                            <div class="float-left">
                                <span>[#list bean.node.hierarchy as n]<a href="${n.url}">${n.name}</a>[#if n_has_next] > [/#if][/#list]</span>
                                <i class="ml-2 fas fa-download"></i> ${bean.bufferDownloads}
                            </div>
                            <div class="float-right"><i class="ml-2 far fa-clock"></i> ${bean.publishDate?string('yyyy-MM-dd')}</div>
                        </div>
                    </div>
                </li>
                [/#list]
            </ul>
            [#include 'page.html'/]
            [/@InfoPage]
        </div>
        <div class="col-sm-4 mt-3 px-4 d-none d-lg-block">
            <h6 class="border-bottom"><span class="border-primary cm-block-head-bottom">下载排行榜</span></h6>
            <div class="px-2 pb-2">
                [@InfoList nodeId=node.id isIncludeChildren='true' sort='downloads desc' limit='10';list]
                [#list list as info]
                <div class="mt-2 d-flex flex-row">
                    <div><span class="badge [#if info_index < 3]badge-primary[#else]badge-secondary[/#if]" style="width:26px;">${info_index+1}</span></div>
                    <div class="ml-2 flex-grow-1 text-truncate"><a class="text-reset small" href="${info.url}">${info.title}</a></div>
                    <div class="text-muted">${info.downloads}</div>
                </div>
                [/#list]
                [/@InfoList]
            </div>
        </div>
    </div>
</div>
[#include 'inc_footer.html'/]
</body>
</html>
[/#escape]